/* 
 * File:   apeDecoder.h
 * Author: hao
 *
 * Created on 2011年5月18日, 上午12:47
 */

#ifndef APEDECODER_H
#define	APEDECODER_H

#include <mac/All.h>
#include <mac/GlobalFunctions.h>
#include <mac/MACLib.h>
#include <mac/CharacterHelper.h>
#include <mac/APETag.h>

#include "APEPluginIO.h"

class apeDecoder {
public:
    apeDecoder();
    
    bool Checking( void * pData, unsigned long long length );
    bool Decoding( void * pTarget, size_t length, size_t * ReadSize );
    void getStatus( unsigned * pFormat, unsigned * pChannels, unsigned * pRate );
    bool SetTrack( int Min, int Second, int Frame, int EndMin, int EndSecond, int EndFrame );
    bool Seek( int Min, int Second, int Frame );
    void getTotalTime( int * pMin, int * pSecond, int * pFrame );
    
    virtual ~apeDecoder();
private:
    
    APEPluginIO pluginIO;
    
    IAPEDecompress * pAPEDecompress;
    
    unsigned long long startBlocks;
    unsigned long long endBlocks;
    unsigned long long currentBlocks;

};

#endif	/* APEDECODER_H */

